package git.soulbgm.config;

import git.soulbgm.pojo.ServerSoftwareStatus;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import java.util.List;
import java.util.Map;

/**
 * 监控配置
 *
 * @author SoulBGM
 * @date 2024-04-07
 */
@Configuration
@ConfigurationProperties(prefix = "config", ignoreUnknownFields = false)
public class MonitorConfig {

    /**
     * 时间同步服务器IP
     * 不填不进行时间同步操作 ntp.ntsc.ac.cn(国家授时中心NTP服务器)
     */
    private String ntpIp;

    /**
     * 监听的网卡名称
     * 不填则自动获取
     */
    private String networkName;

    /**
     * 监控中心IP和端口 多个中心以逗号隔开
     * 例如 192.168.1.10:8206,192.168.2.10:8206
     */
    private List<String> centre;

    /**
     * 向监控中心发送监控数据间隔时间(秒)
     */
    private int intervalTime = 5;

    /**
     * 需要监控的服务名称和心跳地址
     */
    private Map<String, List<ServerSoftwareStatus>> service;

    /**
     * 需要监控的软件名称和进程名称列表
     */
    private Map<String, List<ServerSoftwareStatus>> software;

    public String getNtpIp() {
        return ntpIp;
    }

    public void setNtpIp(String ntpIp) {
        this.ntpIp = ntpIp;
    }

    public String getNetworkName() {
        return networkName;
    }

    public void setNetworkName(String networkName) {
        this.networkName = networkName;
    }

    public List<String> getCentre() {
        return centre;
    }

    public void setCentre(List<String> centre) {
        this.centre = centre;
    }

    public int getIntervalTime() {
        return intervalTime;
    }

    public void setIntervalTime(int intervalTime) {
        this.intervalTime = intervalTime;
    }

    public Map<String, List<ServerSoftwareStatus>> getService() {
        return service;
    }

    public void setService(Map<String, List<ServerSoftwareStatus>> service) {
        this.service = service;
    }

    public Map<String, List<ServerSoftwareStatus>> getSoftware() {
        return software;
    }

    public void setSoftware(Map<String, List<ServerSoftwareStatus>> software) {
        this.software = software;
    }
}
